GXOpenConnectionRetry
QuickDraw GX sends theGXOpenConnectionRetrymessage if opening the connection fails. You can override theGXOpenConnectionRetrymessage to try again to open the connection for a device. Your override of theGXOpenConnectionRetrymessage must match the following formal declaration:
OSErr MyOpenConnectionRetry (ResType commType, void *commData, Boolean *pRetry, OSErr saveErr);
commType- The resource type of the communications (
'comm') resource to use. The possible values are shown in Table 4-9.commData- A pointer to the communications resource that is stored with the desktop printer.
pRetry- On return, the Boolean value is
trueif QuickDraw GX needs to send theGXOpenConnectionmessage again andfalseif not.saveErr- The error code generated when the
GXOpenConnectionmessage failed.- function result
- An error code. The value
noErrindicates that the operation was successful.DESCRIPTION
QuickDraw GX sends theGXOpenConnectionRetrymessage when a message handler calls theGXOpenConnectionand it returns an error. You can override this message when you are implementing a communications protocol for a printer that can be shared by multiple users and accepts only one connection at a time. Your override can interpret the error that is specified in thesaveErrparameter as an indication that the printer is in use by another user and that the connection attempt needs to be tried again.The type of the communications resource, which you specify in the
commTypeparameter, is one of the values shown in Table 4-9.The default implementation of the
OpenRetryConnectionmessage sets the value of thepRetryreturn parameter tofalsefor most devices. The exception is for PAP devices that are using the PostScript imaging system. In this case, the default implementation sets thepRetryparameter value totrueif it determines that the printer is busy with another user's print job.If your device automatically handles retrying connections, override this message and set the
pRetryparameter totrue.SPECIAL CONSIDERATIONS
You never send theGXOpenConnectionRetrymessage yourself.If you are implementing a nonsupported type of communications connection, you need to perform a total override of the
GXOpenConnectionRetrymessage. Otherwise, you need to first forward the message and then perform your tasks.RESULT CODES
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. SEE ALSO
TheGXOpenConnectionmessage is described in the previous section.The communications (
'comm') resource is described in the section "The Communications ('comm') Resource" beginning on page 6-36 in the chapter "Printing Resources."
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help